#include "sizeselect.h"
#include "ui_sizeselect.h"
#include"common.h"
#include"time.h"
#include<QLabel>
#include<QDebug>

class QLabel;

SizeSelect::SizeSelect(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SizeSelect)
{
    ui->setupUi(this);
    connect(ui->Size_comboBox, SIGNAL(activated(QString)), this, SLOT(randomValue(QString)));
}

SizeSelect::~SizeSelect()
{
    delete ui;
}

void SizeSelect::randomValue(QString sizeString)
{
    srand((unsigned long)time(0)) ;
    word rand_value;
    sizeString = ui->Size_comboBox->currentText();
    if(sizeString == "1 bit")
    {
        size_random(1,rand_value);
    }
    else if(sizeString == "4 bits")
    {
        size_random(4,rand_value);
    }
    else if(sizeString == "8 bits")
    {
        size_random(8,rand_value);
    }
    else if(sizeString == "32 bits")
    {
        size_random(32,rand_value);
    }
    else
    {
        qDebug()<<"Error";
    }

}
